﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MarvinsArena.Core;

namespace BattleLogic
{
	public class Camera : ICamera
	{
        public int EmptyTarget { get { return -1; } }
        public int TargetIndex { get; set; }

        public bool MoveOnDefaultPosition { get; set; }

		public bool isMoveLeft { get; set; }
		public bool isMoveRight { get; set; }
		public bool isMoveUp { get; set; }
		public bool isMoveDown { get; set; }

		public void NextTarget(int countRobot)
		{
            this.MoveOnDefaultPosition = false;

            this.TargetIndex++;
            if (this.TargetIndex >= countRobot)
            {
                this.TargetIndex = this.EmptyTarget;
                this.MoveOnDefaultPosition = true;
            }

		}

		public void Move(Controls controls)
		{
			this.isMoveLeft = controls.isCameraMoveLeft;
			this.isMoveRight = controls.isCameraMoveRight;
			this.isMoveDown = controls.isCameraMoveDown;
			this.isMoveUp = controls.isCameraMoveUp;

            if (this.isMoveDown || this.isMoveLeft || this.isMoveRight || this.isMoveUp)
                MoveOnDefaultPosition = false;
		}
	}
}
